updated fixed several bugs from null