added security and tweaked stuff