Fixed the getId() null pointer