added KEEP_ALIVE and handling of deassociation and reassociation