Add unit Tests and fix browser reload