Not working implementation of incrementing number on server