adds better errors
adds a basic validation