fixed mysql queries and loading order
Merge pull request #4 from pandaman09/master

fixed mysql queries and loading order