Electronic device and method of controlling electronic device