Removed debuging alert and little refactored condition