Proper way of handling the background task