Fix bug
added function to add in wpf