fixed bug not adding leading slash to path if needed