put init function in closure