Bug Fix

Fixing a null pointer exception