fixing deprecated warnings and errors