Fix bug that crashes when closes

Based on trello card(s)