fixing center problem when resize