Add two try/catch blocks to prevent NPEs on startup