adding mobile piece to middleware