made param() more robust