making caption an attribute