check permissions before enter synchronized block