bug fixing and base url handling