found problem with sql statement and it is now fixed.
final fix.
Merge pull request #118 from kmabey/LocalDev

Local dev