updated callback method, but it's so bad. someone teach me :(