change empty checking order