Added some code to fix screen blanking