Prevent application crash on error