fix crash bug in beds mod