fixed test and bug