* add check if state name exists * Apply suggestions from code review --------- Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>