Fixes #6 issue of sending data to server twice