Fixed browser "back" functionality + 500 error