changes to prevent page freeze after print