Fix bug with trait