hacky fix for pointer casting