added option for callback