synchronizing a method