Bugfixing in getting badges