fixed a bug when parameter was 0