Added in some validation