fixed a bug when purchased amount is empty