Added logic to hopefully support canvas as well webgl