Fixed stupied mistake

Added a check to see if there was no bucket