Fix issue with retcode 2 in state