used .bind(this) and fixed indentation