Added type checks