output handler improved.
input handler fixed. Test This with gui.