added helper method for calling JS callbacks