Fixing bug thanks @joelbrady