Added some front-end security check