bug fixes, use replace-state instead of push-state