Moved from read write lock to using a content provider to fix db locked issues