add length check in grade model