fixed path and replace issues