Add test and redirect on error