fixed passing information from the database and displaying pins from database