added hasAlpha variable