Fixed problem with deprecated function.

Signed-off-by: Carlos Escribano Rey <carlos@markhaus.com>