Replaced deprecated function for 2.4 compatibility