move script declaration out of head