Automatic reset mechanism added