some changes for task locking problem