Solves the issue of crashing on closing