supports absolute path
added a complete example
code for handling absolute path