If else in function is_empty removed