fix screen sleep preferences save when closing and opening app