Solved crash

App does no longer crash when submitting from create_invoice. I made a
temporary solution by creating a function that redirects the user to
the index page