added init function to send last state