fixed bug to work from other directories as well