Add time threshold to check if in background