fixes from expo, add lock to prevent crashing issue