make the method synchronized
added a check on whether or not the MatchingTaskEntity is null
changed the order of code and somehow solved the blocking issue