Finally works! Still need to show success or error message to the user though.