method and function param validation now checks the types too