Fix variable status check