changed unshift to pop in connects with list