trying to run within the constructor resulted in null pointer exception