fixed positioning problem in centre function()