add more checking and clarify the cases we have