if statement with "status" variable corrected