fixed js error related to pjax
fixed pjax loading errors
fixed random number error
Removed duplicate code and added search function