Fixed error in the printScreen method