fix codes according to test