move the instagram object to middleware