Added option to have acelerometer action only when screen is on