adding reposition function for main div