final fixes to get server script working (why did I call it browser sript????)