added form errors, needs refactoring definitely but works