bugfixes for client side code