functions to determine background mode