fixed a bug where the wrong bin variable was being called