Bugs in background

Fixed some bugs in background