fixed bug in calculating bonus