added 'preventInvalidInput' option