Fix bug and add new assertation