fixed tap() functionality to deal with errors