solving a bug