added database security and encoding