Fixed #366

Fixed crash