Fix unclosed function