updating get statement to be inside if.