attribute added to wrong function