fixed a bug in bin getting