Added validation to the python script