fix some warnings
rewrite a deprecated method