Improve attach controller