corrected issues fagu pointed out