Function correctBackground