Fix bug when typing ctrl+D