Fixed annoying undefined length error