init functions into before