try except block to check the arguments and some changes