pivot and bug fix