adding vertical centering logic in js