modified hook to use relativepath