Fixed OpenInSamePage functionality