created add_sql_limit function and changed other functions to use it