fixed bug with optional argument