Now uses prepared statement for limit variable