Added error reporting anda validation