php version

removed redundant code and fixed validation errors