Just an note: $user is not available in the function ?