Users with login key security working
Move function to library class
Set debug mode