prevents camera from hanging by making sure it executes on the main thread