fixing collapse error