add unit test and change create query