fixed sorting not correct issue