- made parameter handling more robust