added condition to check that width and height are digits