bug fixes for centering