added optional param support