Fix scrolling issue after modal is closed

this is just the solution suggested in one of the issues.
should fix #266 #298 #283 #314