move !empty check