fixed restoring from small terminal