removed wrong variable assignment in wait state