fix attendance being destroyed if empty code