Added wake and wifi lock
Added errorOccurred call on metadata exceptions
Added locked query before release
Added locked query before release