doesnt redirect on last page on development