removed unused code and minor fix