Fixed deprecated function for 2.8