Fixing error with background/foreground