mixed up order of operations in router.php