fixed restoring input