bugfix

a bug lead to crash