Fix issue with shifting window when opening modal