changed controller to check for range and updated test