Fixed realpath issue