logic complete for detail remove button