Is it not dangerous to cast immediatly the input ? If my ID is 'abc' (cast => 0) I will look for the error for a looong time.