Bug fix for awarding badge