fix onSuccess to be optional