fixed some bugs. *now* security should work ok. testing it out!