fix bug not able to delete spaces