changed way init and dispose worked