replaced == '' with empty()