Fixed some issues with custom success function