fix condition
consider limit case on SQL query