bed lua, cleanup