changed isLock to check whether mutex is locked and that we have a valid mutex; removed unused printf statements