Added null verification