trying to remove undefined error