add functions for the fields
fix the error message formating