added realpath function