add security, more test coverage