adding test to initialize and fixing initialize