tried a new function - working but not in backgroud still