Fixed SQL Query in makePin method