please merge this with the previous if() - you're repeating too much code.