implementaion of the unit server state machine behaviour wirh action and message