added option  to function