removed console logs, added checks for callback