fix so it can run as both element and attribute