Fixed callback function