Fix bug in auto capture