cleaned up code, still having callback issues