added foreground flag