bug in getting pin from database

compiles