fixing bug with centering