fixed ending dropout and added text handling