java callbacks but some threading error