Fix while loop no limit Add $pages > 50 rule

Signed-off-by: shajou <doshajou@gmail.com>