Add fix to avoid potential NPE