implemented invoice validation