Adds some validation