I managed to fix that. The problem was that I opened a new connection on each procedure. I just moved the code for opening the connection on the GUI_APP_MAIN and scraped from the procedure and the problem was solved. Not sure why this made the application crash, though.