Fixed bug with undefined