beginning of status bar logic