added specs and updated error messages