Smart redirect via  and removed stray var_dumps etc