fixed indentation and replaced before with let