Fixed to use loyal database
Fixed all changes for js