added validation for screen width&height