fixed shortage bug