removed buggy behavior when inserting text