Fixes possible NullPointerException