Fixed null pointer exception for now.