fix an exception causing app crash