Added firebase locking mechanism.