Fixing select tag from database function