modify a_findAndModify function to address recursive locks issue