working through adding nm middleware