added a code incase row is empty