Added some better form checking