added checks for empty arguments