fixed misuse of rlock