Added check for id