imrpoved security, fixed some bugs