fixed a bug: modified the way of detecting relative path