omg the validity check is sooo bad