Safety improvements
Added some security