bug fixes + new callback + cleanup

Signed-off-by: Umair Khan <omerjerk@gmail.com>