non-absolute path issue

After initially fixing the issue, I refactored it, since the check for absolute path was not needed anymore.