synchronization with auth branch
fixed possible NPE