Fixed bug with no end