Fixed error where we get NullPointerException