replaced 'undefined' with 'throw'
throw didnt work, passing undefined instead