Changed line 100 to containsKey for the hashmap to stop the NPE