added diagnostics and clear input names