Webalizer issue when inside script

hello gurus,

When i run the command on shell

webalizer -p -n mydomain.com -c /path/to/my/log/webalizer.conf

it works fine and it creates stats for the given mydomain.com in the target output directory

but when i put it in a script same command and parameters but it goes weird and it creates stats for whole machine (NOT of given specific mydomain.com) to output directory

Please advise i am using #!/bin/bash as interrupter i also used /bin/sh

Looking forward to your kind replies...