fix issues with the content script not being loaded in time, make server more secure