fixed to use not deprecated function