correcting if statment