fixed ordering of calculating command and options