bug fixes, changed php client to reconnect on every query