script for server side