Fix bug in absolute path

Check if the path is absolute and return the correct path