add security and debug mode