Added errors and validation