Fixed logic error for checking staff flag

Main code rev. 1933