Changed deprecated function in order to avoid server logs