This is causing bugs

The serverside code needs a rewrite.