Maryland lawmaker apologizes for using racial slur