Memory effect and its switching by electric field in solid-state gas sensors