fixed stupid NPE with lock