fixed bugs with security