handle_attach in model