some js stuff for security check