Fixed a bug and cleared textbox