broke check.php into controller and view, fixed file path bug