Fixing faulty error redirect