Implemented a fail-proof way to scroll successfully.