fixed bug in amd