Fixing Railway Hoisting Issue

orm is defined on the var declared two lines below the if block and not on the expected global reference
Merge pull request #203 from danshultz/patch-1

Fixing Railway Hoisting Issue