Added end brace to cleanup function