fixed gcm bugs