fix bug when screen is off