Fix JS error when changing tabs on profile page