making core data operations in background thread + small bug fixing