fixed bad status check