changed code to make work on server, attempt