Added better input validation to the -p argument