Fixed crash after device lock/unlock