Fixed nil pointer bug