renamed header.r as options.r
and created function check_modules that placed at start of key functions