retreat and bug fixes