corrected isempty bug