Prevent modal screen overflow

fixes #288