Added fix to prevent thread crash in remote datastore
fixed merge