I don't want to encapsulated a separate function to check it in the main function,
I think it will be more flexible in here.