checking if script is running in background or not