Added a bugfix because I forgot to close a function