Fixed bug in screen resizing