updated input validator function and named pre handlers