switched the order so formatting hdfs is completed after start up namenode