server script now differentiates between links and dirs