Added guard statement. Not sure this is working as I need to to

- Will be looking at another state machine library