added form checking and username checking